import { ResPage, Restaurant } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";
import qs from "qs";

/**
 * @name 餐厅管理模块
 */

// 获取桌台列表
export const getFoodDeskList = (params?: {}) => {
  return http.post<ResPage<Restaurant.ResFoodDeskList>>(PORT1 + `/CoreCmsFoodDesk/GetPageList`, qs.stringify(params));
};

// 创建餐台资料
export const createFoodDesk = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDesk/DoCreate`, params);
};

// 获取餐台详情
export const getEditFoodDesk = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDesk/GetEdit`, params);
};

// 删除餐台资料
export const deleteFoodDesk = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDesk/DoDelete`, params);
};

// 编辑餐台资料
export const editFoodDesk = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDesk/DoEdit`, params);
};

// 获取桌台区域列表
export const getFoodDeskCategoryList = (params?: {}) => {
  return http.post<ResPage<Restaurant.ResFoodDeskCategoryList>>(
    PORT1 + `/CoreCmsFoodDeskCategory/GetPageList`,
    qs.stringify(params)
  );
};

// 创建餐台区域
export const createFoodDeskCategory = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskCategory/DoCreate`, params);
};

// 删除餐台区域
export const deleteFoodDeskCategory = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskCategory/DoDelete`, params);
};

// 编辑餐台区域资料
export const editFoodDeskCategory = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskCategory/DoEdit`, params);
};

// 生成餐台二维码
export const getFoodDeskQrCode = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDesk/GetFoodDeskQrCode`, qs.stringify(params));
};

// 设置副屏
export const editScreen = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsScreen/doEdit`, params);
};

// 获取副屏设置信息
export const getScreenInfo = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsScreen/getEdit`, params);
};

// 获取服务费列表
export const getFoodDeskFeeList = (params?: {}) => {
  return http.post<ResPage<Restaurant.ResFoodDeskFeeList>>(PORT1 + `/CoreCmsFoodDeskFee/GetPageList`, qs.stringify(params));
};

// 获取服务费详情
export const getEditFoodDeskFee = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskFee/GetEdit`, params);
};

// 创建服务费
export const createFoodDeskFee = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskFee/DoCreate`, params);
};

// 编辑服务费
export const editFoodDeskFee = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskFee/DoEdit`, params);
};

// 停用 启用
export const changeStatusFoodDeskFee = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskFee/ChangeStatus`, params);
};

// 删除服务费规则
export const deleteFoodDeskFee = (params?: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDeskFee/DoDelete`, params);
};

// 下载二维码安装包
export const downloadCodeAPI = (params: {}) => {
  return http.post(PORT1 + `/CoreCmsFoodDesk/DownLoadCommonQrCode`, qs.stringify(params));
};
